package inspire13.duckhuntroid;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

public class Shot 
{
	private int mPosX;
	private int mPosY;
	private int mWidth;
	private int mHeight;
	private float mScaleX;
	private float mScaleY;
	
	private Drawable msprite0;
	private Drawable msprite1;
	private Drawable msprite2;
	private Drawable msprite3;
	
	public Shot(Drawable sprite0, Drawable sprite1, Drawable sprite2, Drawable sprite3, int posX, int posY, int width, int height)
	{
		mPosX = posX;
		mPosY = posY;
		mWidth = width;
		mHeight = height;
		
		msprite0 = sprite0;
		msprite1 = sprite1;
		msprite2 = sprite2;
		msprite3 = sprite3;
	}
	
	public void SetScale(float scaleX, float scaleY)
	{
		mScaleX = scaleX;
		mScaleY = scaleY;
		mWidth =(int)(mWidth * scaleX);
		mHeight =(int)(mHeight * scaleY);
	}
	
	public void Draw(Canvas canvas, int id)
	{
		int right = (int) ((mPosX + mWidth));
		int bot = (int) ((mPosY + mHeight));
		
		if (id == 0)
		{
			msprite0.setBounds(mPosX, mPosY, right, bot);
			msprite0.draw(canvas);
		}
		else if (id == 1)
		{
			msprite1.setBounds(mPosX, mPosY, right, bot);
			msprite1.draw(canvas);
		}
		else if (id == 2)
		{
			msprite2.setBounds(mPosX, mPosY, right, bot);
			msprite2.draw(canvas);
		}
		else if (id == 3)
		{
			msprite3.setBounds(mPosX, mPosY, right, bot);
		    msprite3.draw(canvas);
		}
	}
}
